(use srfi-18 tcp)


(define-values (in out) (tcp-connect "localhost" 9010))

(define processa-in
  (lambda ()
    (let ((str (read-line in)))
      (print str)
      (if (equal? str "> ")
          (begin
            (let ((answer (read-line)))
              (write-line answer out)
              (processa-in)
              ))
          (processa-in)))))

;(thread-join! (thread-start! (make-thread processa-in)))
(processa-in)

